<#include "../common/layout/__mainlayout.html">
<#include "../common/__pagination.html">

        <!--设置面包屑-->
        <#assign pageBreadCrumbs>
            <li class="active"><a href="#">应用推荐</a></li>
            <li class="active"><a href="#">精品推荐</a></li>
        </#assign>
        <#assign pageCss>
            <!-- page specific plugin styles -->
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/jquery-ui.custom.css" />

            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/chosen.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/datepicker.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/daterangepicker.css"/>

        </#assign>

        <#assign pageJavascript>
            <script type="text/javascript">
                $(document).ready(function () {


                    // 清除远程modal数据
                    $("#editModal").on("hidden.bs.modal", function () {
                        $(this).removeData("bs.modal");
                    });

                    // 删除按钮
                    $("a.delete").on(ace.click_event, function (e) {
                        submitClickListener(this, e, "删除");
                    });

                    function submitClickListener(obj, e, title) {
                        var currentA = obj;
                        e.preventDefault();
                        bootbox.confirm({
                                    message: "确定" + title + "该推荐信息?",
                                    buttons: {
                                        confirm: {
                                            label: "确定",
                                            className: "btn-primary btn-sm"
                                        },
                                        cancel: {
                                            label: "取消",
                                            className: "btn-sm"
                                        }
                                    },
                                    callback: function (result) {
                                        if (result) {
                                            url = $(currentA).attr("href");
                                            $.get(url, {}, function (data) {
                                                if (data) {
                                                    window.location.href=window.location.href;
                                                }
                                            });
                                        }
                                    }
                                }
                        );
                    }
                });
            </script>
        </#assign>

        <@mainlayout pageBreadCrumbs=pageBreadCrumbs pageCss=pageCss pageJavascript=pageJavascript
        currentMenu="recommendFlag-recommendListFlag">
        <div class="row">
            <div class="col-xs-12">
                <form id="searchForm" class="form-search form-inline" action="/admin/soft/recommendList.do">
                    <div class="row">
                        <div class="widget-body">
                            <div class="widget-main">
                                <div class="form-group col-xs-12" style="padding-top:10px">
                                    <label class="col-xs-1 text-right">软件编号:</label>
                                    <input type="number" id="softId" name="softId" class="input-sm col-xs-2"  max="99999999999"
                                           value="${query.softId!}"/>
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    <label class="col-xs-1 text-right">推荐类型:</label>
                                    <select class="col-xs-2"  name="recType" id="recType">
                                            <option value="" >请选择</option>
                                            <option value="1">精品推荐</option>
                                            <option value="2">应用</option>
                                            <option value="3">游戏</option>
                                    </select>
                                    &nbsp;&nbsp;&nbsp;&nbsp;

                                    <input type="submit" class="btn btn-sm btn-primary" value="查询"/>&nbsp;
                                </div>
                            </div>
                        </div>
                    </div>

                    <table id="softRecommendTable" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th width="40" align="center">软件编号</th>
                            <th width="40" align="center">软件名称</th>
                            <th width="100" align="left">推荐类型</th>
                            <th width="70" align="left">推荐理由</th>
                            <th width="70" align="left">推荐人</th>
                            <th width="70" align="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list softRecommends.listData as softRecommend>
                            <tr>
                                <td>${softRecommend.softId!}</td>
                                <td>${softRecommend.softName!}</td>
                                <td>${softRecommend.recName!}</td>
                                <td>${softRecommend.recommendReason!}</td>
                                <td>${softRecommend.createAdminName!}</td>
                                <td>
                                    <div class="hidden-sm hidden-xs action-buttons">
                                        <a class="green tooltip-warning listSoftItems" href="${ctx}/admin/soft/viewRecommend.do?softId=${softRecommend.softId!}"  data-rel="tooltip"  data-toggle="modal" data-target="#editModal"> <span class="label label-warning">编辑</span></a>
                                        <a class="red tooltip-error delete"
                                           href="${ctx}/admin/soft/delSoftRecommend.do?id=${softRecommend.id!}" data-rel="tooltip"
                                          > <span class="label label-danger">删除</span> </a>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                    <@pagination softRecommends!/>
                </form>

            </div>
        </div>
    <div id="editModal" class="modal fade" data-backdrop="static">
        <div class="modal-dialog">
            <div class="modal-content">
            </div>
        </div>
    </div>
    </@mainlayout>